<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui">
    
    <p:dataTable value="#{disciplinaCtrl.disciplinas}" var="disciplina" emptyMessage="Nenhuma disciplina cadastrada" selection="#{disciplinaCtrl.disciplina}" selectionMode="single" rowKey="#{disciplina.id}">
        <f:facet name="header">
            <h:outputText value="DISCIPLINAS" />
        </f:facet>
        
        <p:column headerText="Código">
            <h:outputText value="#{disciplina.codigo}" />
        </p:column>
        
        <p:column headerText="Nome">
            <h:outputText value="#{disciplina.nome}" />
        </p:column>
        
        <p:column headerText="Curso">
            <h:outputText value="#{disciplina.curso.nome}" />
        </p:column>
        
        <p:column headerText="CH Total">
            <h:outputText value="#{disciplina.cargaHorariaTotal}" />
        </p:column>
        
        <p:ajax event="rowSelect" update=":form-sidebar" />
    </p:dataTable>
</ui:composition>